<div ng-controller="newsCtrl">
    <div class="x_panel" >
        <div class="form-inline">
            <div class="form-group">
                <label>标题：</label>
                <input type="text" ng-model="search.name"  class="form-control" />
            </div>
           <!-- <div class="form-group">
                <label>年份：</label>
                <select class="form-control" ng-model="search.year"
                        ng-options="o[0] as o[1] for o in $root.yearList">
                    <option value="">&#45;&#45;请选择&#45;&#45;</option>
                </select>
            </div>-->
            <button class="btn btn-primary" ng-click="find(1)" >查询</button>
            <button class="btn btn-default" ng-click="search={}" >重置</button>
            <button class="btn btn-primary pull-right" ng-click="edit()" >添加</button>
        </div>
    </div>
    <table class="table table-bordered table-striped table-hover" >
        <thead class="title">
        <tr>
            <th class="text-center">NO</th>
            <th>标题</th>
            <th>新闻日期</th>
            <th style="width:120px">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-if="pageModel.data.length == 0">
            <td colspan="100" class="text-center">暂无记录</td>
        </tr>
        <tr ng-repeat="item in pageModel.data">
            <td class="text-center">{{$index + 1+pageModel.pageSize*pageModel.pageIndex}}</td>
            <td>{{item.title}}</td>
            <td>{{item.time|date:'yyyy-MM-dd'}}</td>
            <td>
                <span ng-click='setTop(item)' class='btn btn-xs btn-link'><i class='fa fa-edit'></i>置顶</span>
                <span ng-click='edit(item)' class='btn btn-xs btn-link'><i class='fa fa-edit'></i>编辑</span>
                <span ng-click='del(item)' class='btn btn-xs btn-link'><i class='fa fa-trash'></i>删除</span>

            </td>
        </tr>
        </tbody>
    </table>
    <div class="page-footer clearfix" >
        <page page-model="pageModel"></page>
    </div>
</div>